<?php

namespace Proj\ResManBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Level
 *
 * @ORM\Table(name="level")
 * @ORM\Entity
 */
class Level
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=255)
     */
    private $name;
    
    /**
     *
     * @var \Doctrine\Common\Collections\ArrayCollection
     * 
     * @ORM\OneToMany(targetEntity="AcademicProgram", mappedBy="level")
     */
    private $academicPrograms;


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     * @return Level
     */
    public function setName($name)
    {
        $this->name = $name;

    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->academicPrograms = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Add academicPrograms
     *
     * @param \Proj\ResManBundle\Entity\AcademicProgram $academicPrograms
     * @return Level
     */
    public function addAcademicProgram(\Proj\ResManBundle\Entity\AcademicProgram $academicPrograms)
    {
        $this->academicPrograms[] = $academicPrograms;

        return $this;
    }

    /**
     * Remove academicPrograms
     *
     * @param \Proj\ResManBundle\Entity\AcademicProgram $academicPrograms
     */
    public function removeAcademicProgram(\Proj\ResManBundle\Entity\AcademicProgram $academicPrograms)
    {
        $this->academicPrograms->removeElement($academicPrograms);
    }

    /**
     * Get academicPrograms
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getAcademicPrograms()
    {
        return $this->academicPrograms;
    }
    
    public function __toString() {
       return $this->name;
    }
}
